/**
 * 
 */
package com.brother.goallife.manager.impl;

import com.brother.goallife.dao.AccountDAO;
import com.brother.goallife.dao.impl.AccountDAOImpl;
import com.brother.goallife.dto.Account;
import com.brother.goallife.exception.FatalException;
import com.brother.goallife.manager.UserManager;

/**
 * @author anhtuan_truong
 *
 */
public class UserManagerImpl implements UserManager {
	
	private AccountDAO accountDAO;
	
	@Override
	public Account findAccountByUsername(String username) throws FatalException {
		return accountDAO.findByUsername(username);
	}
	
	@Override
	public Account findAccoutByID(int id) throws FatalException {
		return ((AccountDAOImpl) accountDAO).findById(id);
	}
	
	@Override
	public void updateAccount(Account account) throws FatalException {
		accountDAO.updateAccount(account);
	}
	
	public void setAccountDAO(AccountDAO accountDAO) {
		this.accountDAO = accountDAO;
	}

}
